<?php
session_start();
if(!empty($_REQUEST["btnThem"]))//có yeu cau them
{
	$tenTK = $_REQUEST["txtTen"];
	$pass = $_REQUEST["txtPass"];
	$tenHT = $_REQUEST["txtTenHienThi"];
	$diaChi = $_REQUEST["txtDiaChi"];
	$dienThoai = $_REQUEST["txtDienThoai"];
	$email = $_REQUEST["txtEmail"];
	if($tenTK != "") //kiểm tra 
	{
		$sql = "insert into taikhoan(TenDangNhap, MatKhau, TenHienThi, DiaChi, DienThoai, Email, BiXoa, MaLoaiTaiKhoan)
		values('$tenTK', '$pass', '$tenHT', '$diaChi', '$dienThoai', '$email', 0, 1)";
		require_once ("database/DataProvider.php");
		$result =  DataProvider::ExecuteQuery($sql);
		if($result)
		{
			$_SESSION['message'] = '<script language="javascript">setTimeout(function() { alert("Register Successfully!"); }, 2000);</script>';
			header ("Location: index.php");		
		}
	}
	
}
?>